<template>
	<view class="flat" @touchmove.stop.prevent>
		<view class="flat-item" @click="goToService">
			<view class="flat-item-icon">
				<image class="flat-item-icon-img" :src="$ICON('/index/home/service.png')" />
			</view>
			<view class="flat-item-label">在线客服</view>
		</view>
		<view class="flat-item" @click="goToShopCar">
			<view class="flat-item-icon">
				<image class="flat-item-icon-img" :src="$ICON('/index/home/shopcar.png')" />
			</view>
			<view class="flat-item-label">购物车</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
	const goToService = () => {
		window.location.href = 'https://work.weixin.qq.com/kfid/kfc5844d11bc58763bb'
	}
	const goToShopCar = () => {
		uni.navigateTo({
			url: '/packagePayment/shopcar/index'
		})
	}
</script>

<style lang="scss" scoped>
	.flat {
		position: fixed;
		top: 786rpx;
		right: 0;
		z-index: 10;
		background: #FFFFFF;
		box-shadow: -4rpx 6rpx 12rpx 2rpx rgba(102, 102, 102, 0.24);
		border-radius: 16rpx 0rpx 0rpx 16rpx;
		padding: 24rpx 16rpx;

		&-item {
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;
			margin-bottom: 24rpx;

			&:last-child {
				margin-bottom: 0;
			}

			&-icon {
				width: 66rpx;
				height: 66rpx;
				margin-bottom: 8rpx;

				&-img {
					width: 100%;
					height: 100%;
					display: block;
				}
			}

			&-label {
				font-weight: 400;
				font-size: 26rpx;
				color: #000000;
				line-height: 36rpx;
				text-align: center;
			}
		}

	}
</style>
